﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace hozoroghiab
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                sql sqlquery = new sql(usertextBox.Text.Trim(), passtextBox.Text.Trim(), "HAMIDREZA-PC", "absent", "30");
                sqlquery.connect();
                Form1 fr = new Form1(sqlquery);
                fr.Show();
                Hide();
            }
            catch
            {
                MessageBox.Show("error");
            }

        }

        private void Login_Load(object sender, EventArgs e)
        {
            usertextBox.Focus();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
